public class Test {
    public static void move(char a, char b){
        System.out.println(a + "->" + b);
    }
    public static void ham(int n, char a, char b, char c){
        if(n == 1)
            move(a,c);
        else {
            ham(n - 1, a, c, b);
            move(a, c);
            ham(n - 1, b, a, c);
        }
    }
    public static void main(String[] args) {
        ham(2, 'A','B','C');
    }
    public static int fac1(int n){
        if(n == 1){
            return 0;
        }else if(n == 2){
            return 1;
        }
        return fac1(n-1) + fac1(n-2);
    }

    public static void main7(String[] args) {
        System.out.println(fac1(7));
    }
    public static int max(int a, int b){
        return a > b ? a : b;
    }
    public static double max(double a, double b, double c){
        double tmp = a > b ? a : b;
        return tmp > c ? tmp : c;
    }
    public static void main6(String[] args) {
        System.out.println(max(12 , 100));
        System.out.println(max(1.0,3.0,2.0));
    }
    public static int sum(int a, int b){
        return a + b;
    }
    public static double sum(double a, double b, double c){
        return a + b + c;
    }
    public static void main5(String[] args) {
        System.out.println(sum(10, 5));
        System.out.println(sum(1.0, 2.0, 3.0));
    }
    public static int fib(int n){
        int fib1 = 0;
        int fib2 = 1;
        int fib3 = -1;
        if(n == 1){
            return fib1;
        }
        if(n == 2){
            return fib2;
        }
        for (int i = 3; i <= n; i++) {
            fib3 = fib1 + fib2;
            fib1 = fib2;
            fib2 = fib3;
        }
        return fib3;
    }
    public static void main4(String[] args) {
        System.out.println(fib(7));
    }
    public static int facSum(int n){
        int ret = 1;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            ret *= i;
            sum += ret;
        }
        return sum;
    }

    public static void main3(String[] args) {
        System.out.println(facSum(4));
    }
    public static int fac(int n){
        int ret = 1;
        for (int i = 1; i <= n; i++) {
            ret *= i;
        }
        return ret;
    }
    public static void main2(String[] args) {
        System.out.println(fac(6));
    }
    public static int max2(int x, int y){
        return (x>y?x:y);
    }
    public static int max3(int a, int b, int c){
        int tmp = max2(a, b);
        return max2(tmp, c);
    }
    public static void main1(String[] args) {
        System.out.println(max3(1, 21, 3));
    }
}
